package com.bianmaba.examples.mybatis.mapper;

import com.bianmaba.examples.mybatis.bean.order.Order;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * @program: bianmaba-web-framework-extends
 * @description:
 * @author: Chenjiabin
 * @create: 2018-04-22 20:29
 **/
@Mapper
public interface OrderMapper {

    @Select("SELECT * FROM `order`")
    List<Order> findAll();

    @Insert("INSERT INTO `order`(number,total) VALUES(#{number},#{total})")
    @Options(useGeneratedKeys = true, keyProperty = "id")
    long insert(Order order);
}
